<template>
  <div style="width:100%;height:100%;background: #00ff00;">
  <div>首页</div>
  <div>{{msg}}</div>
    <div>当前域:{{domain}}</div>
  </div>
</template>

<script>
import { ref} from "vue";
import {apiHome} from "../../api/api";
export default {
  name: "Home",
  setup() {
    //保存用户数据的变量
    const msg = ref("");
    const domain = ref("");
    //从接口获取用户信息
    const info = async () => {
      apiHome({
      }).then(res => {
        //成功
        if (res.code == 0) {
          //Object.assign(state, res.data);
          msg.value = res.data.msg;
          domain.value =  res.data.domain;
        }
      }).catch((error) => {
        console.log(error)
      })
    };
    info();
    return {
      info,
      msg,
      domain,
    };
  }


}
</script>

<style scoped>

</style>
